
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module Collatz</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>Collatz</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/v/filer4b/v38q001/mgabriel/Desktop/cs373/Project_1/Collatz.py">/v/filer4b/v38q001/mgabriel/Desktop/cs373/Project_1/Collatz.py</a></font></td></tr></table>
    <p><tt>#&nbsp;----------------------------------<br>
#&nbsp;projects/python/collatz/Collatz.py<br>
#&nbsp;Copyright&nbsp;(C)&nbsp;2010<br>
#&nbsp;Glenn&nbsp;P.&nbsp;Downing<br>
#&nbsp;----------------------------------</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-cacheCycLen"><strong>cacheCycLen</strong></a>(n)</dt><dd><tt>#&nbsp;cacheCycLen<br>
#&nbsp;&nbsp;&nbsp;&nbsp;fills&nbsp;the&nbsp;cache&nbsp;with&nbsp;the&nbsp;cycle&nbsp;lengths&nbsp;of&nbsp;the&nbsp;indexes<br>
#&nbsp;&nbsp;&nbsp;&nbsp;does&nbsp;this&nbsp;recursively</tt></dd></dl>
 <dl><dt><a name="-collatz_eval"><strong>collatz_eval</strong></a>(a)</dt><dd><tt>computes&nbsp;the&nbsp;max&nbsp;cycle&nbsp;length&nbsp;in&nbsp;the&nbsp;range&nbsp;[i,&nbsp;j]<br>
and&nbsp;stores&nbsp;the&nbsp;result&nbsp;in&nbsp;v</tt></dd></dl>
 <dl><dt><a name="-collatz_print"><strong>collatz_print</strong></a>(w, a, v)</dt><dd><tt>prints&nbsp;the&nbsp;values&nbsp;of&nbsp;a[0],&nbsp;a[1],&nbsp;and&nbsp;v</tt></dd></dl>
 <dl><dt><a name="-collatz_read"><strong>collatz_read</strong></a>(r, a)</dt><dd><tt>reads&nbsp;an&nbsp;int&nbsp;into&nbsp;a[0]&nbsp;and&nbsp;a[1]<br>
return&nbsp;true&nbsp;if&nbsp;that&nbsp;succeeds,&nbsp;false&nbsp;otherwise</tt></dd></dl>
 <dl><dt><a name="-myMax"><strong>myMax</strong></a>(cache, i, j)</dt><dd><tt>#&nbsp;myMax<br>
#&nbsp;&nbsp;finds&nbsp;the&nbsp;max&nbsp;value&nbsp;between&nbsp;two&nbsp;indices.</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>cache</strong> = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...]<br>
<strong>size</strong> = 10001</td></tr></table>
</body></html>